/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

/**
 *
 * @author usuario
 */
@Entity

public class Usuario implements Serializable {

    //------------------------------------------
    //
    //------------------------------------------

    private static final long serialVersionUID = 1L;

    private final static int ADMIN =0;

    private final static int OWN=1;

    private final static int HAB=2;

    @ManyToMany
    private List<Inmueble> inmuebles;

        //------------------------------------------
    //
    //------------------------------------------
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private String id;

    @Column
    private int hashPwd;

    @Column
    private int perfil;



    //------------------------------------------
    //
    //------------------------------------------


     public int getHashPwd() {
        return hashPwd;
    }

    public void setHashPwd(int hashPwd) {
        this.hashPwd = hashPwd;
    }

    public int getPerfil() {
        return perfil;
    }

    public void setPerfil(int perfil) {
        this.perfil = perfil;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuario)) {
            return false;
        }
        Usuario other = (Usuario) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Usuario[id=" + id + "]";
    }
}
